package com.ssm.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Data
@TableName("student")
@NoArgsConstructor
@AllArgsConstructor
public class Student {
    @TableId(type = IdType.AUTO)
    private Long id;
    private String name;
    private Integer age;
    private String sex;
    private String addr;
    private Long cid;
    private String cname;
    // 逻辑删除字段
    @TableLogic
    private Integer isDeleted;

    // 自动填充配置
    @TableField(fill = FieldFill.INSERT)            // 插入数据时填充
    private LocalDateTime createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)     // 插入和修改时都会填充
    private LocalDateTime updateTime;

}
